home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Burning & Media / GB-PVR 1.2.13 / GBPVR10213.msi / Cabs.w1.cab / RSS.aspx.cs148 < prev    next >
Encoding:
Text File  |  2007-06-16  |  2.9 KB  |  65 lines

  1. using System;
  2. using System.Web.UI;
  3.  
  4. namespace gbweb
  5. {
  6.     public partial class RSS : Page
  7.     {
  8.         protected string url;
  9.  
  10.         protected void Page_PreRender(object sender, EventArgs e)
  11.         {
  12.             GBPVR.RSS.RSS rss = new GBPVR.RSS.RSS();
  13.             string filter = Request.Params["filter"];
  14.  
  15.             url = Request.Url.ToString().Replace(
  16.                             Request.Url.Scheme + Uri.SchemeDelimiter + Request.Url.Authority,
  17.                             Request.Url.Scheme + Uri.SchemeDelimiter + Request.Headers["Host"]);
  18.             try
  19.             {
  20.                 url = url.Substring(0, url.IndexOf("/gbpvr/"));  
  21.             }
  22.             catch
  23.             {
  24.                 url = url.Substring(0, url.IndexOf("/gbweb/"));
  25.             }
  26.             
  27.             if (filter != null)
  28.             {
  29.                 Response.Clear();
  30.                 rssFeedInfo.Visible = false;
  31.                 Response.AppendHeader("Content-Type", "text/xml");
  32.                 if ((Request.Params["encl_dir"] != null) && (Request.Params["encl_port"] != null))
  33.                 {
  34.                     Response.Write(rss.genRss(false, filter, null, false, url, false, Request.Params["encl_dir"], Request.Params["encl_port"]));
  35.                 }
  36.                 else
  37.                 {
  38.                     Response.Write(rss.genRss(false, filter, null, false, url, false)); 
  39.                 }
  40.                 
  41.                 return;
  42.             }
  43.             else
  44.             {
  45.                 in_progressLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=in-progress");
  46.                 completedLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=completed");
  47.                 pendingLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=pending");
  48.                 conflictLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=conflict");
  49.                 failedLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=failed");
  50.                 seasonLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=season");
  51.                 deletedLinkH.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=deleted");
  52.  
  53.                 in_progressLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=in-progress");
  54.                 completedLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=completed");
  55.                 pendingLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=pending");
  56.                 conflictLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=conflict");
  57.                 failedLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=failed");
  58.                 seasonLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=season");
  59.                 deletedLinkB.Attributes.Add("href", url + "/gbpvr/public/rss.aspx?filter=deleted");
  60.             }
  61.         }
  62.  
  63.     }
  64. }
  65.